import { createI18n } from 'vue-i18n'
import store from '../store'
console.log('store,:', store)
const messages = {
  en: {
    message: {
      hello: '{msg} world',
      news: 'news'
    }
  },
  zh: {
    message: {
      hello: '哈喽',
      news: '新闻'
    }
  }
}

const i18n = createI18n({
  // fallbackLocale: 'zh',
  globalInjection: true,
  legacy: false, // you must specify 'legacy: false' option
  locale: localStorage.getItem('locale') || store.getters.getLanguage,
  messages
})

export default i18n
